﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WumpusTest
{
    public class GameController
    {
        protected UserInterface userInterface;
        protected GraphicsEngine graphicsEngine;
        protected GamestateSerializer gamestateSerializer;
        protected Gamestate currentGamestate;
        protected RandomGamestateGenerator randomGamestateGenerator;

        protected const string savepath = "/savedata/";

        public GameController()
        {
            userInterface = new UserInterface();
            graphicsEngine = new GraphicsEngine();
            gamestateSerializer = new GamestateSerializer(savepath);
            randomGamestateGenerator = new RandomGamestateGenerator();

            if (gamestateSerializer.DoesGamestateExist())
            {
                currentGamestate = gamestateSerializer.Load();
            }
            else
            {
                currentGamestate = randomGamestateGenerator.Generate(
                    minNumPlanets: 10,
                    maxNumPlanets: 15,
                    numBats: 3,
                    numHoles: 1);
            }
        }

        /// <summary>
        /// Called when the game is activated.  Loads the
        /// state from the filesystem.
        /// </summary>
        public void Activate()
        {
            
        }

        /// <summary>
        /// Called when the game loses focus.
        /// Saves the map to the filesystem.
        /// </summary>
        public void Deactivate()
        {
            
        }

        /// <summary>
        /// The windows phone should automatically call this repeatedly to update things.
        /// </summary>
        public void Update()
        {
            
        }

        /// <summary>
        /// Use the graphics engine, etc. to draw things to the screen.
        /// </summary>
        public void Draw()
        {
            
        }
    }

    

    public class GraphicsEngine
    {

    }
}
